<template>
  <div>
    <div class="row-title">
      <div class="logo-cell">
        <img src="../img/logo.jpg" class="logo" />
        <span class="logo-font">广州市杰控机械有限公司</span>
      </div>
      <div class="title">扭矩传感器校准系统</div>
      <div>{{gettime}}</div>
    </div>
    <div class="row-cell">
      <div>
        <span class="row-cell-l">测试编号：</span>
        <el-input v-model="testNumber" placeholder="测试编号" size="mini" class="input-cell" clearable></el-input>
      </div>
      <div>
        <el-switch
          v-model="AvrCptFlag"
          active-color="#13ce66"
          inactive-color="#ff4949"
          @change="AvrCptFlagChange"
        ></el-switch>
        <span class="row-cell-l">平均值计算：</span>
        <el-input v-model="AvrCpt" size="mini" class="input-cell" :disabled="true"></el-input>
      </div>
      <div>
        <el-button type="primary" round size="mini" @click="newTest" :disabled="newTestFlag">新测试</el-button>
        <!-- <el-button type="danger" round size="mini">继续测试</el-button> -->
      </div>
    </div>
    <div class="row-cell">
      <div>
        <span class="row-cell-l">实际温度：</span>
        <el-input v-model="RealTemp" size="mini" class="input-cell" disabled></el-input>
      </div>
      <div>
        <span class="row-cell-l">校对温度1：</span>
        <el-input v-model="Temp1" size="mini" class="input-cell" disabled></el-input>
      </div>
      <div>
        <span class="row-cell-l">校对温度2：</span>
        <el-input v-model="Temp2" size="mini" class="input-cell" disabled></el-input>
      </div>
    </div>
    <div class="row-cell">
      <div>
        <span class="row-cell-l">实际温度平均值：</span>
        <el-input v-model="RealTempAverage" size="mini" class="input-cell" disabled></el-input>
      </div>
      <div>
        <span class="row-cell-l">校对温度1平均值：</span>
        <el-input v-model="Temp1Average" size="mini" class="input-cell" disabled></el-input>
      </div>
      <div>
        <span class="row-cell-l">校对温度2平均值：</span>
        <el-input v-model="Temp2Average" size="mini" class="input-cell" disabled></el-input>
      </div>
    </div>
    <div class="row-cell">
      <div>
        <span class="row-cell-l">实际扭矩：</span>
        <el-input v-model="RealTorque" size="mini" class="input-cell" disabled></el-input>
      </div>
      <div>
        <span class="row-cell-l">校对扭矩1：</span>
        <el-input v-model="Torque1" size="mini" class="input-cell" disabled></el-input>
      </div>
      <div>
        <span class="row-cell-l">校对扭矩2：</span>
        <el-input v-model="Torque2" size="mini" class="input-cell" disabled></el-input>
      </div>
    </div>
    <div class="row-cell">
      <div>
        <span class="row-cell-l">实际扭矩平均值：</span>
        <el-input v-model="RealTorqueAverage" size="mini" class="input-cell" disabled></el-input>
      </div>
      <div>
        <span class="row-cell-l">校对扭矩1平均值：</span>
        <el-input v-model="Torque1Average" size="mini" class="input-cell" disabled></el-input>
      </div>
      <div>
        <span class="row-cell-l">校对扭矩2平均值：</span>
        <el-input v-model="Torque2Average" size="mini" class="input-cell" disabled></el-input>
      </div>
    </div>
    <div class="csv">
      <el-button type="primary" round size="mini" @click="exportCsv">导出CSV</el-button>
    </div>
    <div class="value-table">
      <el-table :data="tableData" style="width: 100%" max-height="250">
        <el-table-column label="外界温度变化" width="110" fixed>
          <el-table-column prop="RealTorque" label="施加的扭矩" width="110"></el-table-column>
        </el-table-column>
        <el-table-column :label="RealTempAverage">
          <el-table-column prop="Torque10" label="校准扭矩1" width="110"></el-table-column>
          <el-table-column prop="Torque20" label="校准扭矩2" width="110"></el-table-column>
          <el-table-column prop="Temp10" label="校准温度1" width="110"></el-table-column>
          <el-table-column prop="Temp20" label="校准温度2" width="110"></el-table-column>
          <el-table-column prop="Torque11" label="校准扭矩1" width="110"></el-table-column>
          <el-table-column prop="Torque21" label="校准扭矩2" width="110"></el-table-column>
          <el-table-column prop="Temp11" label="校准温度1" width="110"></el-table-column>
          <el-table-column prop="Temp21" label="校准温度2" width="110"></el-table-column>
          <el-table-column prop="Torque12" label="校准扭矩1" width="110"></el-table-column>
          <el-table-column prop="Torque22" label="校准扭矩2" width="110"></el-table-column>
          <el-table-column prop="Temp12" label="校准温度1" width="110"></el-table-column>
          <el-table-column prop="Temp22" label="校准温度2" width="110"></el-table-column>
          <el-table-column prop="Torque13" label="校准扭矩1" width="110"></el-table-column>
          <el-table-column prop="Torque23" label="校准扭矩2" width="110"></el-table-column>
          <el-table-column prop="Temp13" label="校准温度1" width="110"></el-table-column>
          <el-table-column prop="Temp23" label="校准温度2" width="110"></el-table-column>
          <el-table-column prop="Torque14" label="校准扭矩1" width="110"></el-table-column>
          <el-table-column prop="Torque24" label="校准扭矩2" width="110"></el-table-column>
          <el-table-column prop="Temp14" label="校准温度1" width="110"></el-table-column>
          <el-table-column prop="Temp24" label="校准温度2" width="110"></el-table-column>
          <el-table-column prop="Torque15" label="校准扭矩1" width="110"></el-table-column>
          <el-table-column prop="Torque25" label="校准扭矩2" width="110"></el-table-column>
          <el-table-column prop="Temp15" label="校准温度1" width="110"></el-table-column>
          <el-table-column prop="Temp25" label="校准温度2" width="110"></el-table-column>
          <el-table-column prop="Torque16" label="校准扭矩1" width="110"></el-table-column>
          <el-table-column prop="Torque26" label="校准扭矩2" width="110"></el-table-column>
          <el-table-column prop="Temp16" label="校准温度1" width="110"></el-table-column>
          <el-table-column prop="Temp26" label="校准温度2" width="110"></el-table-column>
          <el-table-column prop="Torque17" label="校准扭矩1" width="110"></el-table-column>
          <el-table-column prop="Torque27" label="校准扭矩2" width="110"></el-table-column>
          <el-table-column prop="Temp17" label="校准温度1" width="110"></el-table-column>
          <el-table-column prop="Temp27" label="校准温度2" width="110"></el-table-column>
          <el-table-column prop="Torque18" label="校准扭矩1" width="110"></el-table-column>
          <el-table-column prop="Torque28" label="校准扭矩2" width="110"></el-table-column>
          <el-table-column prop="Temp18" label="校准温度1" width="110"></el-table-column>
          <el-table-column prop="Temp28" label="校准温度2" width="110"></el-table-column>
          <el-table-column prop="Torque19" label="校准扭矩1" width="110"></el-table-column>
          <el-table-column prop="Torque29" label="校准扭矩2" width="110"></el-table-column>
          <el-table-column prop="Temp19" label="校准温度1" width="110"></el-table-column>
          <el-table-column prop="Temp29" label="校准温度2" width="110"></el-table-column>
          <el-table-column prop="Torque110" label="校准扭矩1" width="110"></el-table-column>
          <el-table-column prop="Torque210" label="校准扭矩2" width="110"></el-table-column>
          <el-table-column prop="Temp110" label="校准温度1" width="110"></el-table-column>
          <el-table-column prop="Temp210" label="校准温度2" width="110"></el-table-column>
          <el-table-column prop="Torque111" label="校准扭矩1" width="110"></el-table-column>
          <el-table-column prop="Torque211" label="校准扭矩2" width="110"></el-table-column>
          <el-table-column prop="Temp111" label="校准温度1" width="110"></el-table-column>
          <el-table-column prop="Temp211" label="校准温度2" width="110"></el-table-column>
        </el-table-column>
      </el-table>
    </div>
    <!-- <el-button type="primary" round size="mini" @click="mqttMsg">mqtt</el-button> -->
    <!-- <el-button type="primary" round size="mini" @click="test">test</el-button> -->
    <!-- <div>
      <el-input v-model="d1" size="mini" class="input-cell"></el-input>
      <el-input v-model="d2" size="mini" class="input-cell"></el-input>
      <el-input v-model="d3" size="mini" class="input-cell"></el-input>
      <el-input v-model="d4" size="mini" class="input-cell"></el-input>
      <el-input v-model="dX" size="mini" class="input-cell"></el-input>
      <el-input v-model="dY" size="mini" class="input-cell"></el-input>
    </div>-->
  </div>
</template>

<script>
import Papa from "papaparse";
import mqtt from "mqtt";

var client;
const options = {
  connectTimeout: 1000,
  clientId: "mqtitId-Home",
  username: "gsg",
  password: "123",
  clean: false
};
client = mqtt.connect("ws://127.0.0.1:9001/", options);
export default {
  data() {
    return {
      d1: 0,
      d2: 0,
      d3: 0,
      d4: 0,
      dX: 0,
      dY: 0,
      //平均值计算开关
      AvrCptFlag: false,
      //新测试开关
      newTestFlag: false,
      gettime: "",
      gettimeNum:"",
      testNumber: "",
      AvrCpt: 0,
      RealTemp: "",
      Temp1: "",
      Temp2: "",
      RealTempAverage: "",
      Temp1Average: "",
      Temp2Average: "",
      RealTorque: "",
      Torque1: "",
      Torque2: "",
      RealTorqueAverage: "",
      Torque1Average: "",
      Torque2Average: "",
      tableData: [
        {
          RealTorque: 0,
          Torque10: null,
          Torque20: null,
          Temp10: null,
          Temp20: null,
          Torque11: null,
          Torque21: null,
          Temp11: null,
          Temp21: null,
          Torque12: null,
          Torque22: null,
          Temp12: null,
          Temp22: null,
          Torque13: null,
          Torque23: null,
          Temp13: null,
          Temp23: null,
          Torque14: null,
          Torque24: null,
          Temp14: null,
          Temp24: null,
          Torque15: null,
          Torque25: null,
          Temp15: null,
          Temp25: null,
          Torque16: null,
          Torque26: null,
          Temp16: null,
          Temp26: null,
          Torque17: null,
          Torque27: null,
          Temp17: null,
          Temp27: null,
          Torque18: null,
          Torque28: null,
          Temp18: null,
          Temp28: null,
          Torque19: null,
          Torque29: null,
          Temp19: null,
          Temp29: null,
          Torque110: null,
          Torque210: null,
          Temp110: null,
          Temp210: null,
          Torque1101: null,
          Torque211: null,
          Temp111: null,
          Temp211: null
        },
        {
          RealTorque: 0,
          Torque10: null,
          Torque20: null,
          Temp10: null,
          Temp20: null,
          Torque11: null,
          Torque21: null,
          Temp11: null,
          Temp21: null,
          Torque12: null,
          Torque22: null,
          Temp12: null,
          Temp22: null,
          Torque13: null,
          Torque23: null,
          Temp13: null,
          Temp23: null,
          Torque14: null,
          Torque24: null,
          Temp14: null,
          Temp24: null,
          Torque15: null,
          Torque25: null,
          Temp15: null,
          Temp25: null,
          Torque16: null,
          Torque26: null,
          Temp16: null,
          Temp26: null,
          Torque17: null,
          Torque207: null,
          Temp107: null,
          Temp207: null,
          Torque18: null,
          Torque28: null,
          Temp18: null,
          Temp28: null,
          Torque19: null,
          Torque29: null,
          Temp19: null,
          Temp29: null,
          Torque110: null,
          Torque210: null,
          Temp110: null,
          Temp210: null,
          Torque1101: null,
          Torque211: null,
          Temp111: null,
          Temp211: null
        },
        {
          RealTorque: 0,
          Torque10: null,
          Torque20: null,
          Temp10: null,
          Temp20: null,
          Torque11: null,
          Torque21: null,
          Temp11: null,
          Temp21: null,
          Torque12: null,
          Torque22: null,
          Temp12: null,
          Temp22: null,
          Torque13: null,
          Torque23: null,
          Temp13: null,
          Temp23: null,
          Torque14: null,
          Torque24: null,
          Temp14: null,
          Temp24: null,
          Torque15: null,
          Torque25: null,
          Temp15: null,
          Temp25: null,
          Torque16: null,
          Torque26: null,
          Temp16: null,
          Temp26: null,
          Torque17: null,
          Torque27: null,
          Temp17: null,
          Temp27: null,
          Torque18: null,
          Torque28: null,
          Temp18: null,
          Temp28: null,
          Torque19: null,
          Torque29: null,
          Temp19: null,
          Temp29: null,
          Torque110: null,
          Torque210: null,
          Temp110: null,
          Temp210: null,
          Torque1101: null,
          Torque211: null,
          Temp111: null,
          Temp211: null
        },
        {
          RealTorque: 0,
          Torque10: null,
          Torque20: null,
          Temp10: null,
          Temp20: null,
          Torque11: null,
          Torque21: null,
          Temp11: null,
          Temp21: null,
          Torque12: null,
          Torque22: null,
          Temp12: null,
          Temp22: null,
          Torque13: null,
          Torque23: null,
          Temp13: null,
          Temp23: null,
          Torque14: null,
          Torque24: null,
          Temp14: null,
          Temp24: null,
          Torque15: null,
          Torque25: null,
          Temp15: null,
          Temp25: null,
          Torque16: null,
          Torque26: null,
          Temp16: null,
          Temp26: null,
          Torque17: null,
          Torque27: null,
          Temp17: null,
          Temp27: null,
          Torque18: null,
          Torque28: null,
          Temp18: null,
          Temp28: null,
          Torque19: null,
          Torque29: null,
          Temp19: null,
          Temp29: null,
          Torque110: null,
          Torque210: null,
          Temp110: null,
          Temp210: null,
          Torque1101: null,
          Torque211: null,
          Temp111: null,
          Temp211: null
        },
        {
          RealTorque: 0,
          Torque10: null,
          Torque20: null,
          Temp10: null,
          Temp20: null,
          Torque11: null,
          Torque21: null,
          Temp11: null,
          Temp21: null,
          Torque12: null,
          Torque22: null,
          Temp12: null,
          Temp22: null,
          Torque13: null,
          Torque23: null,
          Temp13: null,
          Temp23: null,
          Torque14: null,
          Torque24: null,
          Temp14: null,
          Temp24: null,
          Torque15: null,
          Torque25: null,
          Temp15: null,
          Temp25: null,
          Torque16: null,
          Torque26: null,
          Temp16: null,
          Temp26: null,
          Torque17: null,
          Torque27: null,
          Temp17: null,
          Temp27: null,
          Torque18: null,
          Torque28: null,
          Temp18: null,
          Temp28: null,
          Torque19: null,
          Torque29: null,
          Temp19: null,
          Temp29: null,
          Torque110: null,
          Torque210: null,
          Temp110: null,
          Temp210: null,
          Torque1101: null,
          Torque211: null,
          Temp111: null,
          Temp211: null
        },
        {
          RealTorque: 0,
          Torque10: null,
          Torque20: null,
          Temp10: null,
          Temp20: null,
          Torque11: null,
          Torque21: null,
          Temp11: null,
          Temp21: null,
          Torque12: null,
          Torque22: null,
          Temp12: null,
          Temp22: null,
          Torque13: null,
          Torque23: null,
          Temp13: null,
          Temp23: null,
          Torque14: null,
          Torque24: null,
          Temp14: null,
          Temp24: null,
          Torque15: null,
          Torque25: null,
          Temp15: null,
          Temp25: null,
          Torque16: null,
          Torque26: null,
          Temp16: null,
          Temp26: null,
          Torque17: null,
          Torque27: null,
          Temp17: null,
          Temp27: null,
          Torque18: null,
          Torque28: null,
          Temp18: null,
          Temp28: null,
          Torque19: null,
          Torque29: null,
          Temp19: null,
          Temp29: null,
          Torque110: null,
          Torque210: null,
          Temp110: null,
          Temp210: null,
          Torque1101: null,
          Torque211: null,
          Temp111: null,
          Temp211: null
        },
        {
          RealTorque: 0,
          Torque10: null,
          Torque20: null,
          Temp10: null,
          Temp20: null,
          Torque11: null,
          Torque21: null,
          Temp11: null,
          Temp21: null,
          Torque12: null,
          Torque22: null,
          Temp12: null,
          Temp22: null,
          Torque13: null,
          Torque23: null,
          Temp13: null,
          Temp23: null,
          Torque14: null,
          Torque24: null,
          Temp14: null,
          Temp24: null,
          Torque15: null,
          Torque25: null,
          Temp15: null,
          Temp25: null,
          Torque16: null,
          Torque26: null,
          Temp16: null,
          Temp26: null,
          Torque17: null,
          Torque27: null,
          Temp17: null,
          Temp27: null,
          Torque18: null,
          Torque28: null,
          Temp18: null,
          Temp28: null,
          Torque19: null,
          Torque29: null,
          Temp19: null,
          Temp29: null,
          Torque110: null,
          Torque210: null,
          Temp110: null,
          Temp210: null,
          Torque1101: null,
          Torque211: null,
          Temp111: null,
          Temp211: null
        },
        {
          RealTorque: 0,
          Torque10: null,
          Torque20: null,
          Temp10: null,
          Temp20: null,
          Torque11: null,
          Torque21: null,
          Temp11: null,
          Temp21: null,
          Torque12: null,
          Torque22: null,
          Temp12: null,
          Temp22: null,
          Torque13: null,
          Torque23: null,
          Temp13: null,
          Temp23: null,
          Torque14: null,
          Torque24: null,
          Temp14: null,
          Temp24: null,
          Torque15: null,
          Torque25: null,
          Temp15: null,
          Temp25: null,
          Torque16: null,
          Torque26: null,
          Temp16: null,
          Temp26: null,
          Torque17: null,
          Torque27: null,
          Temp17: null,
          Temp27: null,
          Torque18: null,
          Torque28: null,
          Temp18: null,
          Temp28: null,
          Torque19: null,
          Torque29: null,
          Temp19: null,
          Temp29: null,
          Torque110: null,
          Torque210: null,
          Temp110: null,
          Temp210: null,
          Torque1101: null,
          Torque211: null,
          Temp111: null,
          Temp211: null
        },
        {
          RealTorque:0,
          Torque10: null,
          Torque20: null,
          Temp10: null,
          Temp20: null,
          Torque11: null,
          Torque21: null,
          Temp11: null,
          Temp21: null,
          Torque12: null,
          Torque22: null,
          Temp12: null,
          Temp22: null,
          Torque13: null,
          Torque23: null,
          Temp13: null,
          Temp23: null,
          Torque14: null,
          Torque24: null,
          Temp14: null,
          Temp24: null,
          Torque15: null,
          Torque25: null,
          Temp15: null,
          Temp25: null,
          Torque16: null,
          Torque26: null,
          Temp16: null,
          Temp26: null,
          Torque17: null,
          Torque27: null,
          Temp17: null,
          Temp27: null,
          Torque18: null,
          Torque28: null,
          Temp18: null,
          Temp28: null,
          Torque19: null,
          Torque29: null,
          Temp19: null,
          Temp29: null,
          Torque110: null,
          Torque210: null,
          Temp110: null,
          Temp210: null,
          Torque1101: null,
          Torque211: null,
          Temp111: null,
          Temp211: null
        },
        {
          RealTorque: 0,
          Torque10: null,
          Torque20: null,
          Temp10: null,
          Temp20: null,
          Torque11: null,
          Torque21: null,
          Temp11: null,
          Temp21: null,
          Torque12: null,
          Torque22: null,
          Temp12: null,
          Temp22: null,
          Torque13: null,
          Torque23: null,
          Temp13: null,
          Temp23: null,
          Torque14: null,
          Torque24: null,
          Temp14: null,
          Temp24: null,
          Torque15: null,
          Torque25: null,
          Temp15: null,
          Temp25: null,
          Torque16: null,
          Torque26: null,
          Temp16: null,
          Temp26: null,
          Torque17: null,
          Torque27: null,
          Temp17: null,
          Temp27: null,
          Torque18: null,
          Torque28: null,
          Temp18: null,
          Temp28: null,
          Torque19: null,
          Torque29: null,
          Temp19: null,
          Temp29: null,
          Torque110: null,
          Torque210: null,
          Temp110: null,
          Temp210: null,
          Torque1101: null,
          Torque211: null,
          Temp111: null,
          Temp211: null
        },
        {
          RealTorque: 0,
          Torque10: null,
          Torque20: null,
          Temp10: null,
          Temp20: null,
          Torque11: null,
          Torque21: null,
          Temp11: null,
          Temp21: null,
          Torque12: null,
          Torque22: null,
          Temp12: null,
          Temp22: null,
          Torque13: null,
          Torque23: null,
          Temp13: null,
          Temp23: null,
          Torque14: null,
          Torque24: null,
          Temp14: null,
          Temp24: null,
          Torque15: null,
          Torque25: null,
          Temp15: null,
          Temp25: null,
          Torque16: null,
          Torque26: null,
          Temp16: null,
          Temp26: null,
          Torque17: null,
          Torque27: null,
          Temp17: null,
          Temp27: null,
          Torque18: null,
          Torque28: null,
          Temp18: null,
          Temp28: null,
          Torque19: null,
          Torque29: null,
          Temp19: null,
          Temp29: null,
          Torque110: null,
          Torque210: null,
          Temp110: null,
          Temp210: null,
          Torque1101: null,
          Torque211: null,
          Temp111: null,
          Temp211: null
        },
        {
          RealTorque: 0,
          Torque10: null,
          Torque20: null,
          Temp10: null,
          Temp20: null,
          Torque11: null,
          Torque21: null,
          Temp11: null,
          Temp21: null,
          Torque12: null,
          Torque22: null,
          Temp12: null,
          Temp22: null,
          Torque13: null,
          Torque23: null,
          Temp13: null,
          Temp23: null,
          Torque14: null,
          Torque24: null,
          Temp14: null,
          Temp24: null,
          Torque15: null,
          Torque25: null,
          Temp15: null,
          Temp25: null,
          Torque16: null,
          Torque26: null,
          Temp16: null,
          Temp26: null,
          Torque17: null,
          Torque27: null,
          Temp17: null,
          Temp27: null,
          Torque18: null,
          Torque28: null,
          Temp18: null,
          Temp28: null,
          Torque19: null,
          Torque29: null,
          Temp19: null,
          Temp29: null,
          Torque110: null,
          Torque210: null,
          Temp110: null,
          Temp210: null,
          Torque1101: null,
          Torque211: null,
          Temp111: null,
          Temp211: null
        },
        {
          RealTorque: 0,
          Torque10: null,
          Torque20: null,
          Temp10: null,
          Temp20: null,
          Torque11: null,
          Torque21: null,
          Temp11: null,
          Temp21: null,
          Torque12: null,
          Torque22: null,
          Temp12: null,
          Temp22: null,
          Torque13: null,
          Torque23: null,
          Temp13: null,
          Temp23: null,
          Torque14: null,
          Torque24: null,
          Temp14: null,
          Temp24: null,
          Torque15: null,
          Torque25: null,
          Temp15: null,
          Temp25: null,
          Torque16: null,
          Torque26: null,
          Temp16: null,
          Temp26: null,
          Torque17: null,
          Torque27: null,
          Temp17: null,
          Temp27: null,
          Torque18: null,
          Torque28: null,
          Temp18: null,
          Temp28: null,
          Torque19: null,
          Torque29: null,
          Temp19: null,
          Temp29: null,
          Torque110: null,
          Torque210: null,
          Temp110: null,
          Temp210: null,
          Torque1101: null,
          Torque211: null,
          Temp111: null,
          Temp211: null
        },
        {
          RealTorque: 0,
          Torque10: null,
          Torque20: null,
          Temp10: null,
          Temp20: null,
          Torque11: null,
          Torque21: null,
          Temp11: null,
          Temp21: null,
          Torque12: null,
          Torque22: null,
          Temp12: null,
          Temp22: null,
          Torque13: null,
          Torque23: null,
          Temp13: null,
          Temp23: null,
          Torque14: null,
          Torque24: null,
          Temp14: null,
          Temp24: null,
          Torque15: null,
          Torque25: null,
          Temp15: null,
          Temp25: null,
          Torque16: null,
          Torque26: null,
          Temp16: null,
          Temp26: null,
          Torque17: null,
          Torque27: null,
          Temp17: null,
          Temp27: null,
          Torque18: null,
          Torque28: null,
          Temp18: null,
          Temp28: null,
          Torque19: null,
          Torque29: null,
          Temp19: null,
          Temp29: null,
          Torque110: null,
          Torque210: null,
          Temp110: null,
          Temp210: null,
          Torque1101: null,
          Torque211: null,
          Temp111: null,
          Temp211: null
        },
        {
          RealTorque: 0,
          Torque10: null,
          Torque20: null,
          Temp10: null,
          Temp20: null,
          Torque11: null,
          Torque21: null,
          Temp11: null,
          Temp21: null,
          Torque12: null,
          Torque22: null,
          Temp12: null,
          Temp22: null,
          Torque13: null,
          Torque23: null,
          Temp13: null,
          Temp23: null,
          Torque14: null,
          Torque24: null,
          Temp14: null,
          Temp24: null,
          Torque15: null,
          Torque25: null,
          Temp15: null,
          Temp25: null,
          Torque16: null,
          Torque26: null,
          Temp16: null,
          Temp26: null,
          Torque17: null,
          Torque27: null,
          Temp17: null,
          Temp27: null,
          Torque18: null,
          Torque28: null,
          Temp18: null,
          Temp28: null,
          Torque19: null,
          Torque29: null,
          Temp19: null,
          Temp29: null,
          Torque110: null,
          Torque210: null,
          Temp110: null,
          Temp210: null,
          Torque1101: null,
          Torque211: null,
          Temp111: null,
          Temp211: null
        },
        {
          RealTorque: 0,
          Torque10: null,
          Torque20: null,
          Temp10: null,
          Temp20: null,
          Torque11: null,
          Torque21: null,
          Temp11: null,
          Temp21: null,
          Torque12: null,
          Torque22: null,
          Temp12: null,
          Temp22: null,
          Torque13: null,
          Torque23: null,
          Temp13: null,
          Temp23: null,
          Torque14: null,
          Torque24: null,
          Temp14: null,
          Temp24: null,
          Torque15: null,
          Torque25: null,
          Temp15: null,
          Temp25: null,
          Torque16: null,
          Torque26: null,
          Temp16: null,
          Temp26: null,
          Torque17: null,
          Torque27: null,
          Temp17: null,
          Temp27: null,
          Torque18: null,
          Torque28: null,
          Temp18: null,
          Temp28: null,
          Torque19: null,
          Torque29: null,
          Temp19: null,
          Temp29: null,
          Torque110: null,
          Torque210: null,
          Temp110: null,
          Temp210: null,
          Torque111: null,
          Torque211: null,
          Temp111: null,
          Temp211: null
        },
        {
          RealTorque: 0,
          Torque10: null,
          Torque20: null,
          Temp10: null,
          Temp20: null,
          Torque11: null,
          Torque21: null,
          Temp11: null,
          Temp21: null,
          Torque12: null,
          Torque22: null,
          Temp12: null,
          Temp22: null,
          Torque13: null,
          Torque23: null,
          Temp13: null,
          Temp23: null,
          Torque14: null,
          Torque24: null,
          Temp14: null,
          Temp24: null,
          Torque15: null,
          Torque25: null,
          Temp15: null,
          Temp25: null,
          Torque16: null,
          Torque26: null,
          Temp16: null,
          Temp26: null,
          Torque17: null,
          Torque27: null,
          Temp17: null,
          Temp27: null,
          Torque18: null,
          Torque28: null,
          Temp18: null,
          Temp28: null,
          Torque19: null,
          Torque29: null,
          Temp19: null,
          Temp29: null,
          Torque110: null,
          Torque210: null,
          Temp110: null,
          Temp210: null,
          Torque1101: null,
          Torque211: null,
          Temp111: null,
          Temp211: null
        },
        {
          RealTorque: 0,
          Torque10: null,
          Torque20: null,
          Temp10: null,
          Temp20: null,
          Torque11: null,
          Torque21: null,
          Temp11: null,
          Temp21: null,
          Torque12: null,
          Torque22: null,
          Temp12: null,
          Temp22: null,
          Torque13: null,
          Torque23: null,
          Temp13: null,
          Temp23: null,
          Torque14: null,
          Torque24: null,
          Temp14: null,
          Temp24: null,
          Torque15: null,
          Torque25: null,
          Temp15: null,
          Temp25: null,
          Torque16: null,
          Torque26: null,
          Temp16: null,
          Temp26: null,
          Torque17: null,
          Torque27: null,
          Temp17: null,
          Temp27: null,
          Torque18: null,
          Torque28: null,
          Temp18: null,
          Temp28: null,
          Torque19: null,
          Torque29: null,
          Temp19: null,
          Temp29: null,
          Torque110: null,
          Torque210: null,
          Temp110: null,
          Temp210: null,
          Torque1101: null,
          Torque211: null,
          Temp111: null,
          Temp211: null
        },
        {
          RealTorque: 0,
          Torque10: null,
          Torque20: null,
          Temp10: null,
          Temp20: null,
          Torque11: null,
          Torque21: null,
          Temp11: null,
          Temp21: null,
          Torque12: null,
          Torque22: null,
          Temp12: null,
          Temp22: null,
          Torque13: null,
          Torque23: null,
          Temp13: null,
          Temp23: null,
          Torque14: null,
          Torque24: null,
          Temp14: null,
          Temp24: null,
          Torque15: null,
          Torque25: null,
          Temp15: null,
          Temp25: null,
          Torque16: null,
          Torque26: null,
          Temp16: null,
          Temp26: null,
          Torque17: null,
          Torque27: null,
          Temp17: null,
          Temp27: null,
          Torque18: null,
          Torque28: null,
          Temp18: null,
          Temp28: null,
          Torque19: null,
          Torque29: null,
          Temp19: null,
          Temp29: null,
          Torque110: null,
          Torque210: null,
          Temp110: null,
          Temp210: null,
          Torque1101: null,
          Torque211: null,
          Temp111: null,
          Temp211: null
        },
        {
          RealTorque: 0,
          Torque10: null,
          Torque20: null,
          Temp10: null,
          Temp20: null,
          Torque11: null,
          Torque21: null,
          Temp11: null,
          Temp21: null,
          Torque12: null,
          Torque22: null,
          Temp12: null,
          Temp22: null,
          Torque13: null,
          Torque23: null,
          Temp13: null,
          Temp23: null,
          Torque14: null,
          Torque24: null,
          Temp14: null,
          Temp24: null,
          Torque15: null,
          Torque25: null,
          Temp15: null,
          Temp25: null,
          Torque16: null,
          Torque26: null,
          Temp16: null,
          Temp26: null,
          Torque17: null,
          Torque27: null,
          Temp17: null,
          Temp27: null,
          Torque18: null,
          Torque28: null,
          Temp18: null,
          Temp28: null,
          Torque19: null,
          Torque29: null,
          Temp19: null,
          Temp29: null,
          Torque110: null,
          Torque210: null,
          Temp110: null,
          Temp210: null,
          Torque1101: null,
          Torque211: null,
          Temp111: null,
          Temp211: null
        }
      ]
    };
  },
  created() {
    this.currentTime();
  },
  watch:{
"AvrCpt":function(newval){
  if(newval==0){
    client.end()
  }
}
  },
  methods: {
    //实时时间
    getTime: function() {
      var _this = this;
      let yy = new Date().getFullYear();
      let mm = new Date().getMonth() + 1;
      if (mm < 10) {
        mm = "0" + mm;
      }
      let dd = new Date().getDate();
      if (dd < 10) {
        dd = "0" + dd;
      }
      let hh = new Date().getHours();
      let mf =
        new Date().getMinutes() < 10
          ? "0" + new Date().getMinutes()
          : new Date().getMinutes();
      let ss =
        new Date().getSeconds() < 10
          ? "0" + new Date().getSeconds()
          : new Date().getSeconds();
      _this.gettime = yy + "-" + mm + "-" + dd + " " + hh + ":" + mf + ":" + ss;
      _this.gettimeNum = yy + mm + dd   + hh  + mf + ss;
    },
    currentTime() {
      setInterval(this.getTime, 500);
    },
    //新测试按钮事件
    newTest() {
      this.testNumber = null;
      this.tableData=[
        {
          RealTorque: 0,
          Torque10: null,
          Torque20: null,
          Temp10: null,
          Temp20: null,
          Torque11: null,
          Torque21: null,
          Temp11: null,
          Temp21: null,
          Torque12: null,
          Torque22: null,
          Temp12: null,
          Temp22: null,
          Torque13: null,
          Torque23: null,
          Temp13: null,
          Temp23: null,
          Torque14: null,
          Torque24: null,
          Temp14: null,
          Temp24: null,
          Torque15: null,
          Torque25: null,
          Temp15: null,
          Temp25: null,
          Torque16: null,
          Torque26: null,
          Temp16: null,
          Temp26: null,
          Torque17: null,
          Torque27: null,
          Temp17: null,
          Temp27: null,
          Torque18: null,
          Torque28: null,
          Temp18: null,
          Temp28: null,
          Torque19: null,
          Torque29: null,
          Temp19: null,
          Temp29: null,
          Torque110: null,
          Torque210: null,
          Temp110: null,
          Temp210: null,
          Torque1101: null,
          Torque211: null,
          Temp111: null,
          Temp211: null
        },
        {
          RealTorque: 0,
          Torque10: null,
          Torque20: null,
          Temp10: null,
          Temp20: null,
          Torque11: null,
          Torque21: null,
          Temp11: null,
          Temp21: null,
          Torque12: null,
          Torque22: null,
          Temp12: null,
          Temp22: null,
          Torque13: null,
          Torque23: null,
          Temp13: null,
          Temp23: null,
          Torque14: null,
          Torque24: null,
          Temp14: null,
          Temp24: null,
          Torque15: null,
          Torque25: null,
          Temp15: null,
          Temp25: null,
          Torque16: null,
          Torque26: null,
          Temp16: null,
          Temp26: null,
          Torque17: null,
          Torque207: null,
          Temp107: null,
          Temp207: null,
          Torque18: null,
          Torque28: null,
          Temp18: null,
          Temp28: null,
          Torque19: null,
          Torque29: null,
          Temp19: null,
          Temp29: null,
          Torque110: null,
          Torque210: null,
          Temp110: null,
          Temp210: null,
          Torque1101: null,
          Torque211: null,
          Temp111: null,
          Temp211: null
        },
        {
          RealTorque: 0,
          Torque10: null,
          Torque20: null,
          Temp10: null,
          Temp20: null,
          Torque11: null,
          Torque21: null,
          Temp11: null,
          Temp21: null,
          Torque12: null,
          Torque22: null,
          Temp12: null,
          Temp22: null,
          Torque13: null,
          Torque23: null,
          Temp13: null,
          Temp23: null,
          Torque14: null,
          Torque24: null,
          Temp14: null,
          Temp24: null,
          Torque15: null,
          Torque25: null,
          Temp15: null,
          Temp25: null,
          Torque16: null,
          Torque26: null,
          Temp16: null,
          Temp26: null,
          Torque17: null,
          Torque27: null,
          Temp17: null,
          Temp27: null,
          Torque18: null,
          Torque28: null,
          Temp18: null,
          Temp28: null,
          Torque19: null,
          Torque29: null,
          Temp19: null,
          Temp29: null,
          Torque110: null,
          Torque210: null,
          Temp110: null,
          Temp210: null,
          Torque1101: null,
          Torque211: null,
          Temp111: null,
          Temp211: null
        },
        {
          RealTorque: 0,
          Torque10: null,
          Torque20: null,
          Temp10: null,
          Temp20: null,
          Torque11: null,
          Torque21: null,
          Temp11: null,
          Temp21: null,
          Torque12: null,
          Torque22: null,
          Temp12: null,
          Temp22: null,
          Torque13: null,
          Torque23: null,
          Temp13: null,
          Temp23: null,
          Torque14: null,
          Torque24: null,
          Temp14: null,
          Temp24: null,
          Torque15: null,
          Torque25: null,
          Temp15: null,
          Temp25: null,
          Torque16: null,
          Torque26: null,
          Temp16: null,
          Temp26: null,
          Torque17: null,
          Torque27: null,
          Temp17: null,
          Temp27: null,
          Torque18: null,
          Torque28: null,
          Temp18: null,
          Temp28: null,
          Torque19: null,
          Torque29: null,
          Temp19: null,
          Temp29: null,
          Torque110: null,
          Torque210: null,
          Temp110: null,
          Temp210: null,
          Torque1101: null,
          Torque211: null,
          Temp111: null,
          Temp211: null
        },
        {
          RealTorque: 0,
          Torque10: null,
          Torque20: null,
          Temp10: null,
          Temp20: null,
          Torque11: null,
          Torque21: null,
          Temp11: null,
          Temp21: null,
          Torque12: null,
          Torque22: null,
          Temp12: null,
          Temp22: null,
          Torque13: null,
          Torque23: null,
          Temp13: null,
          Temp23: null,
          Torque14: null,
          Torque24: null,
          Temp14: null,
          Temp24: null,
          Torque15: null,
          Torque25: null,
          Temp15: null,
          Temp25: null,
          Torque16: null,
          Torque26: null,
          Temp16: null,
          Temp26: null,
          Torque17: null,
          Torque27: null,
          Temp17: null,
          Temp27: null,
          Torque18: null,
          Torque28: null,
          Temp18: null,
          Temp28: null,
          Torque19: null,
          Torque29: null,
          Temp19: null,
          Temp29: null,
          Torque110: null,
          Torque210: null,
          Temp110: null,
          Temp210: null,
          Torque1101: null,
          Torque211: null,
          Temp111: null,
          Temp211: null
        },
        {
          RealTorque: 0,
          Torque10: null,
          Torque20: null,
          Temp10: null,
          Temp20: null,
          Torque11: null,
          Torque21: null,
          Temp11: null,
          Temp21: null,
          Torque12: null,
          Torque22: null,
          Temp12: null,
          Temp22: null,
          Torque13: null,
          Torque23: null,
          Temp13: null,
          Temp23: null,
          Torque14: null,
          Torque24: null,
          Temp14: null,
          Temp24: null,
          Torque15: null,
          Torque25: null,
          Temp15: null,
          Temp25: null,
          Torque16: null,
          Torque26: null,
          Temp16: null,
          Temp26: null,
          Torque17: null,
          Torque27: null,
          Temp17: null,
          Temp27: null,
          Torque18: null,
          Torque28: null,
          Temp18: null,
          Temp28: null,
          Torque19: null,
          Torque29: null,
          Temp19: null,
          Temp29: null,
          Torque110: null,
          Torque210: null,
          Temp110: null,
          Temp210: null,
          Torque1101: null,
          Torque211: null,
          Temp111: null,
          Temp211: null
        },
        {
          RealTorque: 0,
          Torque10: null,
          Torque20: null,
          Temp10: null,
          Temp20: null,
          Torque11: null,
          Torque21: null,
          Temp11: null,
          Temp21: null,
          Torque12: null,
          Torque22: null,
          Temp12: null,
          Temp22: null,
          Torque13: null,
          Torque23: null,
          Temp13: null,
          Temp23: null,
          Torque14: null,
          Torque24: null,
          Temp14: null,
          Temp24: null,
          Torque15: null,
          Torque25: null,
          Temp15: null,
          Temp25: null,
          Torque16: null,
          Torque26: null,
          Temp16: null,
          Temp26: null,
          Torque17: null,
          Torque27: null,
          Temp17: null,
          Temp27: null,
          Torque18: null,
          Torque28: null,
          Temp18: null,
          Temp28: null,
          Torque19: null,
          Torque29: null,
          Temp19: null,
          Temp29: null,
          Torque110: null,
          Torque210: null,
          Temp110: null,
          Temp210: null,
          Torque1101: null,
          Torque211: null,
          Temp111: null,
          Temp211: null
        },
        {
          RealTorque: 0,
          Torque10: null,
          Torque20: null,
          Temp10: null,
          Temp20: null,
          Torque11: null,
          Torque21: null,
          Temp11: null,
          Temp21: null,
          Torque12: null,
          Torque22: null,
          Temp12: null,
          Temp22: null,
          Torque13: null,
          Torque23: null,
          Temp13: null,
          Temp23: null,
          Torque14: null,
          Torque24: null,
          Temp14: null,
          Temp24: null,
          Torque15: null,
          Torque25: null,
          Temp15: null,
          Temp25: null,
          Torque16: null,
          Torque26: null,
          Temp16: null,
          Temp26: null,
          Torque17: null,
          Torque27: null,
          Temp17: null,
          Temp27: null,
          Torque18: null,
          Torque28: null,
          Temp18: null,
          Temp28: null,
          Torque19: null,
          Torque29: null,
          Temp19: null,
          Temp29: null,
          Torque110: null,
          Torque210: null,
          Temp110: null,
          Temp210: null,
          Torque1101: null,
          Torque211: null,
          Temp111: null,
          Temp211: null
        },
        {
          RealTorque:0,
          Torque10: null,
          Torque20: null,
          Temp10: null,
          Temp20: null,
          Torque11: null,
          Torque21: null,
          Temp11: null,
          Temp21: null,
          Torque12: null,
          Torque22: null,
          Temp12: null,
          Temp22: null,
          Torque13: null,
          Torque23: null,
          Temp13: null,
          Temp23: null,
          Torque14: null,
          Torque24: null,
          Temp14: null,
          Temp24: null,
          Torque15: null,
          Torque25: null,
          Temp15: null,
          Temp25: null,
          Torque16: null,
          Torque26: null,
          Temp16: null,
          Temp26: null,
          Torque17: null,
          Torque27: null,
          Temp17: null,
          Temp27: null,
          Torque18: null,
          Torque28: null,
          Temp18: null,
          Temp28: null,
          Torque19: null,
          Torque29: null,
          Temp19: null,
          Temp29: null,
          Torque110: null,
          Torque210: null,
          Temp110: null,
          Temp210: null,
          Torque1101: null,
          Torque211: null,
          Temp111: null,
          Temp211: null
        },
        {
          RealTorque: 0,
          Torque10: null,
          Torque20: null,
          Temp10: null,
          Temp20: null,
          Torque11: null,
          Torque21: null,
          Temp11: null,
          Temp21: null,
          Torque12: null,
          Torque22: null,
          Temp12: null,
          Temp22: null,
          Torque13: null,
          Torque23: null,
          Temp13: null,
          Temp23: null,
          Torque14: null,
          Torque24: null,
          Temp14: null,
          Temp24: null,
          Torque15: null,
          Torque25: null,
          Temp15: null,
          Temp25: null,
          Torque16: null,
          Torque26: null,
          Temp16: null,
          Temp26: null,
          Torque17: null,
          Torque27: null,
          Temp17: null,
          Temp27: null,
          Torque18: null,
          Torque28: null,
          Temp18: null,
          Temp28: null,
          Torque19: null,
          Torque29: null,
          Temp19: null,
          Temp29: null,
          Torque110: null,
          Torque210: null,
          Temp110: null,
          Temp210: null,
          Torque1101: null,
          Torque211: null,
          Temp111: null,
          Temp211: null
        },
        {
          RealTorque: 0,
          Torque10: null,
          Torque20: null,
          Temp10: null,
          Temp20: null,
          Torque11: null,
          Torque21: null,
          Temp11: null,
          Temp21: null,
          Torque12: null,
          Torque22: null,
          Temp12: null,
          Temp22: null,
          Torque13: null,
          Torque23: null,
          Temp13: null,
          Temp23: null,
          Torque14: null,
          Torque24: null,
          Temp14: null,
          Temp24: null,
          Torque15: null,
          Torque25: null,
          Temp15: null,
          Temp25: null,
          Torque16: null,
          Torque26: null,
          Temp16: null,
          Temp26: null,
          Torque17: null,
          Torque27: null,
          Temp17: null,
          Temp27: null,
          Torque18: null,
          Torque28: null,
          Temp18: null,
          Temp28: null,
          Torque19: null,
          Torque29: null,
          Temp19: null,
          Temp29: null,
          Torque110: null,
          Torque210: null,
          Temp110: null,
          Temp210: null,
          Torque1101: null,
          Torque211: null,
          Temp111: null,
          Temp211: null
        },
        {
          RealTorque: 0,
          Torque10: null,
          Torque20: null,
          Temp10: null,
          Temp20: null,
          Torque11: null,
          Torque21: null,
          Temp11: null,
          Temp21: null,
          Torque12: null,
          Torque22: null,
          Temp12: null,
          Temp22: null,
          Torque13: null,
          Torque23: null,
          Temp13: null,
          Temp23: null,
          Torque14: null,
          Torque24: null,
          Temp14: null,
          Temp24: null,
          Torque15: null,
          Torque25: null,
          Temp15: null,
          Temp25: null,
          Torque16: null,
          Torque26: null,
          Temp16: null,
          Temp26: null,
          Torque17: null,
          Torque27: null,
          Temp17: null,
          Temp27: null,
          Torque18: null,
          Torque28: null,
          Temp18: null,
          Temp28: null,
          Torque19: null,
          Torque29: null,
          Temp19: null,
          Temp29: null,
          Torque110: null,
          Torque210: null,
          Temp110: null,
          Temp210: null,
          Torque1101: null,
          Torque211: null,
          Temp111: null,
          Temp211: null
        },
        {
          RealTorque: 0,
          Torque10: null,
          Torque20: null,
          Temp10: null,
          Temp20: null,
          Torque11: null,
          Torque21: null,
          Temp11: null,
          Temp21: null,
          Torque12: null,
          Torque22: null,
          Temp12: null,
          Temp22: null,
          Torque13: null,
          Torque23: null,
          Temp13: null,
          Temp23: null,
          Torque14: null,
          Torque24: null,
          Temp14: null,
          Temp24: null,
          Torque15: null,
          Torque25: null,
          Temp15: null,
          Temp25: null,
          Torque16: null,
          Torque26: null,
          Temp16: null,
          Temp26: null,
          Torque17: null,
          Torque27: null,
          Temp17: null,
          Temp27: null,
          Torque18: null,
          Torque28: null,
          Temp18: null,
          Temp28: null,
          Torque19: null,
          Torque29: null,
          Temp19: null,
          Temp29: null,
          Torque110: null,
          Torque210: null,
          Temp110: null,
          Temp210: null,
          Torque1101: null,
          Torque211: null,
          Temp111: null,
          Temp211: null
        },
        {
          RealTorque: 0,
          Torque10: null,
          Torque20: null,
          Temp10: null,
          Temp20: null,
          Torque11: null,
          Torque21: null,
          Temp11: null,
          Temp21: null,
          Torque12: null,
          Torque22: null,
          Temp12: null,
          Temp22: null,
          Torque13: null,
          Torque23: null,
          Temp13: null,
          Temp23: null,
          Torque14: null,
          Torque24: null,
          Temp14: null,
          Temp24: null,
          Torque15: null,
          Torque25: null,
          Temp15: null,
          Temp25: null,
          Torque16: null,
          Torque26: null,
          Temp16: null,
          Temp26: null,
          Torque17: null,
          Torque27: null,
          Temp17: null,
          Temp27: null,
          Torque18: null,
          Torque28: null,
          Temp18: null,
          Temp28: null,
          Torque19: null,
          Torque29: null,
          Temp19: null,
          Temp29: null,
          Torque110: null,
          Torque210: null,
          Temp110: null,
          Temp210: null,
          Torque1101: null,
          Torque211: null,
          Temp111: null,
          Temp211: null
        },
        {
          RealTorque: 0,
          Torque10: null,
          Torque20: null,
          Temp10: null,
          Temp20: null,
          Torque11: null,
          Torque21: null,
          Temp11: null,
          Temp21: null,
          Torque12: null,
          Torque22: null,
          Temp12: null,
          Temp22: null,
          Torque13: null,
          Torque23: null,
          Temp13: null,
          Temp23: null,
          Torque14: null,
          Torque24: null,
          Temp14: null,
          Temp24: null,
          Torque15: null,
          Torque25: null,
          Temp15: null,
          Temp25: null,
          Torque16: null,
          Torque26: null,
          Temp16: null,
          Temp26: null,
          Torque17: null,
          Torque27: null,
          Temp17: null,
          Temp27: null,
          Torque18: null,
          Torque28: null,
          Temp18: null,
          Temp28: null,
          Torque19: null,
          Torque29: null,
          Temp19: null,
          Temp29: null,
          Torque110: null,
          Torque210: null,
          Temp110: null,
          Temp210: null,
          Torque1101: null,
          Torque211: null,
          Temp111: null,
          Temp211: null
        },
        {
          RealTorque: 0,
          Torque10: null,
          Torque20: null,
          Temp10: null,
          Temp20: null,
          Torque11: null,
          Torque21: null,
          Temp11: null,
          Temp21: null,
          Torque12: null,
          Torque22: null,
          Temp12: null,
          Temp22: null,
          Torque13: null,
          Torque23: null,
          Temp13: null,
          Temp23: null,
          Torque14: null,
          Torque24: null,
          Temp14: null,
          Temp24: null,
          Torque15: null,
          Torque25: null,
          Temp15: null,
          Temp25: null,
          Torque16: null,
          Torque26: null,
          Temp16: null,
          Temp26: null,
          Torque17: null,
          Torque27: null,
          Temp17: null,
          Temp27: null,
          Torque18: null,
          Torque28: null,
          Temp18: null,
          Temp28: null,
          Torque19: null,
          Torque29: null,
          Temp19: null,
          Temp29: null,
          Torque110: null,
          Torque210: null,
          Temp110: null,
          Temp210: null,
          Torque111: null,
          Torque211: null,
          Temp111: null,
          Temp211: null
        },
        {
          RealTorque: 0,
          Torque10: null,
          Torque20: null,
          Temp10: null,
          Temp20: null,
          Torque11: null,
          Torque21: null,
          Temp11: null,
          Temp21: null,
          Torque12: null,
          Torque22: null,
          Temp12: null,
          Temp22: null,
          Torque13: null,
          Torque23: null,
          Temp13: null,
          Temp23: null,
          Torque14: null,
          Torque24: null,
          Temp14: null,
          Temp24: null,
          Torque15: null,
          Torque25: null,
          Temp15: null,
          Temp25: null,
          Torque16: null,
          Torque26: null,
          Temp16: null,
          Temp26: null,
          Torque17: null,
          Torque27: null,
          Temp17: null,
          Temp27: null,
          Torque18: null,
          Torque28: null,
          Temp18: null,
          Temp28: null,
          Torque19: null,
          Torque29: null,
          Temp19: null,
          Temp29: null,
          Torque110: null,
          Torque210: null,
          Temp110: null,
          Temp210: null,
          Torque1101: null,
          Torque211: null,
          Temp111: null,
          Temp211: null
        },
        {
          RealTorque: 0,
          Torque10: null,
          Torque20: null,
          Temp10: null,
          Temp20: null,
          Torque11: null,
          Torque21: null,
          Temp11: null,
          Temp21: null,
          Torque12: null,
          Torque22: null,
          Temp12: null,
          Temp22: null,
          Torque13: null,
          Torque23: null,
          Temp13: null,
          Temp23: null,
          Torque14: null,
          Torque24: null,
          Temp14: null,
          Temp24: null,
          Torque15: null,
          Torque25: null,
          Temp15: null,
          Temp25: null,
          Torque16: null,
          Torque26: null,
          Temp16: null,
          Temp26: null,
          Torque17: null,
          Torque27: null,
          Temp17: null,
          Temp27: null,
          Torque18: null,
          Torque28: null,
          Temp18: null,
          Temp28: null,
          Torque19: null,
          Torque29: null,
          Temp19: null,
          Temp29: null,
          Torque110: null,
          Torque210: null,
          Temp110: null,
          Temp210: null,
          Torque1101: null,
          Torque211: null,
          Temp111: null,
          Temp211: null
        },
        {
          RealTorque: 0,
          Torque10: null,
          Torque20: null,
          Temp10: null,
          Temp20: null,
          Torque11: null,
          Torque21: null,
          Temp11: null,
          Temp21: null,
          Torque12: null,
          Torque22: null,
          Temp12: null,
          Temp22: null,
          Torque13: null,
          Torque23: null,
          Temp13: null,
          Temp23: null,
          Torque14: null,
          Torque24: null,
          Temp14: null,
          Temp24: null,
          Torque15: null,
          Torque25: null,
          Temp15: null,
          Temp25: null,
          Torque16: null,
          Torque26: null,
          Temp16: null,
          Temp26: null,
          Torque17: null,
          Torque27: null,
          Temp17: null,
          Temp27: null,
          Torque18: null,
          Torque28: null,
          Temp18: null,
          Temp28: null,
          Torque19: null,
          Torque29: null,
          Temp19: null,
          Temp29: null,
          Torque110: null,
          Torque210: null,
          Temp110: null,
          Temp210: null,
          Torque1101: null,
          Torque211: null,
          Temp111: null,
          Temp211: null
        },
        {
          RealTorque: 0,
          Torque10: null,
          Torque20: null,
          Temp10: null,
          Temp20: null,
          Torque11: null,
          Torque21: null,
          Temp11: null,
          Temp21: null,
          Torque12: null,
          Torque22: null,
          Temp12: null,
          Temp22: null,
          Torque13: null,
          Torque23: null,
          Temp13: null,
          Temp23: null,
          Torque14: null,
          Torque24: null,
          Temp14: null,
          Temp24: null,
          Torque15: null,
          Torque25: null,
          Temp15: null,
          Temp25: null,
          Torque16: null,
          Torque26: null,
          Temp16: null,
          Temp26: null,
          Torque17: null,
          Torque27: null,
          Temp17: null,
          Temp27: null,
          Torque18: null,
          Torque28: null,
          Temp18: null,
          Temp28: null,
          Torque19: null,
          Torque29: null,
          Temp19: null,
          Temp29: null,
          Torque110: null,
          Torque210: null,
          Temp110: null,
          Temp210: null,
          Torque1101: null,
          Torque211: null,
          Temp111: null,
          Temp211: null
        }
      ]
    },
    //平均值计算开关事件
    AvrCptFlagChange() {
      this.newTestFlag = !this.newTestFlag;
      if(this.AvrCpt==0){
        this.AvrCpt=1
      }else{
        this.AvrCpt=0
      }
    },
    /**
     * by wjw
     * 导出指令csv文件
     */
    exportCsv() {
      var csv = Papa.unparse(this.tableData);
      //定义文件内容，类型必须为Blob 否则createObjectURL会报错
      let content = new Blob([csv]);
      //生成url对象
      let urlObject = window.URL || window.webkitURL || window;
      let url = urlObject.createObjectURL(content);
      //生成<a></a>DOM元素
      let el = document.createElement("a");
      //链接赋值
      el.href = url;
      el.download = this.testNumber+"_"+this.gettimeNum+"TTAvr.csv";
      //必须点击否则不会下载
      el.click();
      //移除链接释放资源
      urlObject.revokeObjectURL(url);
    },
    mqttMsg() {
      client.on("connect", e => {
        console.log("连接成功！！！");
        client.subscribe("/MacServer01", { qos: 0 }, error => {
          if (!error) {
            console.log("订阅成功");
          } else {
            console.log("订阅失败");
          }
        });
      });
      // 接收消息处理
      client.on("message", (topic, message) => {
        var msg = JSON.parse(message.toString());
        var type = msg["Root"]["Node"]["MacServer01"];
        if (type["Itf1"]) {
          var typeValue = type["Itf1"]["Devices"]["Dev1"]["Tags"];
          this.RealTemp = typeValue["RealTemp"];
          if (!this.RealTempAverage) {
            this.RealTempAverage = typeValue["RealTemp"];
          } else {
            this.RealTempAverage =
              (Number(this.RealTempAverage) + Number(typeValue["RealTemp"])) /
              2;
          }
        }
        if (type["Itf3"]) {
          var typeValue = type["Itf3"]["Devices"]["Dev3"]["Tags"];
          this.Temp1 = typeValue["Temp1"];
          this.Temp2 = typeValue["Temp2"];
          this.RealTorque = typeValue["RealTorque"];
          this.Torque1 = typeValue["Torque1"];
          this.Torque2 = typeValue["Torque2"];
          //Temp1平均值
          if (this.Temp1Average) {
            this.Temp1Average =
              (Number(this.Temp1Average) + Number(typeValue["Temp1"])) / 2;
          } else {
            this.Temp1Average = typeValue["Temp1"];
          }
          //Temp2平均值
          if (this.Temp2Average) {
            this.Temp2Average =
              (Number(this.Temp2Average) + Number(typeValue["Temp2"])) / 2;
          } else {
            this.Temp2Average = typeValue["Temp2"];
          }
          //实际扭矩平均值
          if (this.RealTorqueAverage) {
            this.RealTorqueAverage =
              (Number(this.RealTorqueAverage) + Number(typeValue["RealTorque"])) / 2;
          } else {
            this.RealTorqueAverage = typeValue["RealTorque"];
          }
          //Torque1平均值
          if (this.Torque1Average) {
            this.Torque1Average =
              (Number(this.Torque1Average) + Number(typeValue["Torque1"])) / 2;
          } else {
            this.Torque1Average = typeValue["Torque1"];
          }
          //Torque2平均值
          if (this.Torque2Average) {
            this.Torque2Average =
              (Number(this.Torque2Average) + Number(typeValue["Torque2"])) / 2;
          } else {
            this.Torque2Average = typeValue["Torque2"];
          }
          //坐标数据
          var dY = typeValue["DataY"];
          var dX = typeValue["DataX"];
          var strTagName = "";
          strTagName = "Torque1" + dX;
          if (!this.tableData[dY][strTagName]) {
            this.tableData[dY][strTagName] = typeValue["Torque1"];
          } else {
            this.tableData[dY][strTagName] =
              (Number(this.tableData[dY][strTagName]) +
                Number(typeValue["Torque1"])) /
              2;
          }
          strTagName = "Torque2" + dX;
          if (!this.tableData[dY][strTagName]) {
            this.tableData[dY][strTagName] = typeValue["Torque2"];
          } else {
            this.tableData[dY][strTagName] =
              (Number(this.tableData[dY][strTagName]) +
                Number(typeValue["Torque2"])) /
              2;
          }
          strTagName = "Temp1" + dX;
          if (!this.tableData[dY][strTagName]) {
            this.tableData[dY][strTagName] = typeValue["Temp1"];
          } else {
            this.tableData[dY][strTagName] =
              (Number(this.tableData[dY][strTagName]) +
                Number(typeValue["Temp1"])) /
              2;
          }
          strTagName = "Temp2" + dX;
          if (!this.tableData[dY][strTagName]) {
            this.tableData[dY][strTagName] = typeValue["Temp2"];
          } else {
            this.tableData[dY][strTagName] =
              (Number(this.tableData[dY][strTagName]) +
                Number(typeValue["Temp2"])) /
              2;
          }
          this.tableData[dY]["RealTorque"] = typeValue["RealTorque"];
          this.AvrCpt=typeValue["AvrCpt"]
        }
      });
    },
  }
};
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
.title {
  font-size: 2rem;
  font-weight: bold;
  color: #0044bb;
}
.row-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 0.01rem solid #5599ff;
  padding-bottom: 1rem;
  margin-bottom: 1rem;
}
.logo-cell {
  display: flex;
  align-items: center;
}
.logo {
  width: 3.8rem;
  height: 3rem;
}
.logo-font {
  font-weight: bold;
}
.row-cell {
  display: flex;
  justify-content: space-around;
  text-align: center;
  padding: 0.3rem 0;
}
.row-cell-l {
  float: left;
  width: 8.6rem;
  text-align: right;
}
.input-cell {
  width: 40%;
}
.value-table {
  padding: 0 2rem;
}
.csv {
  text-align: center;
  margin: 1rem;
}
</style>
